import { getTypeApi } from "../../api"

const actions = {
  getType(context) {
    getTypeApi(
      (response) => {
        if (response.data.status !== 1) return;
        context.commit("GETTYPE", response.data.data)
      },
      (err) => {
        console.log(err);
      }
    );
  }
}

const mutations = {
  GETTYPE(state, value) {
    state.type = value;
  },
}

const getters = {

}

const state = {
  type: null,
}

export default {
  namespaced: true,
  actions,
  mutations,
  getters,
  state,
}